package com.fit.user.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;

public class GetMsgFromFile {

	public static String getMsg(String path) {
//		String path = System.getProperty("user.dir");
//		System.out.println(path);
//		File file = new File("D:\\sectionmsg.txt");
		File file = new File(path);
		String readLine = "";
		try {
			FileInputStream fileInputStream = new FileInputStream(file);

			InputStreamReader inputStreamReader = new InputStreamReader(
					fileInputStream);
			BufferedReader bufferedReader = new BufferedReader(
					inputStreamReader);

			try {
				readLine = bufferedReader.readLine();
				System.out.println(readLine);
			} catch (IOException e) {
				e.printStackTrace();
			}

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}

		return readLine;
	}

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

		 GetMsgFromFile.getMsg("");
		System.out.println();//

	}

}
